﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace AutoDeployForSims.From18To10Cfg.Utility
{ 
    public static class StringSplit
    {
        public static string[] SplitRemoveEndEmptyEntries(this string str, string[] separator)
        {
            List<string> strs = str.Split(separator, StringSplitOptions.None).ToList();
            for (int i = strs.Count - 1; i >= 0; i--)
            {
                if (string.IsNullOrEmpty(strs[i]))
                    strs.RemoveAt(i);
                else
                    break;
            }
            return strs.ToArray();
        }
    }
}
